<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/share/taglib.jsp" %>
<%  String path = request.getContextPath(); %>
<html>
<head>
 	<title>个人中心</title>
	 <script type="text/javascript" src="<%=path%>/script/jquery-1.3.2.min.js"></script>
	<link href="<%=path%>/style/imitation.css" rel="stylesheet" type="text/css" />
	<link href="<%=path%>/style/usercenter.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
	</script>
</head>
<body>
<center>
	<div style="width:950px;">
 <jsp:include page="/head.jsp"/>
 	<jsp:include page="/WEB-INF/share/leftmenu.jsp"/>
	
	<font color="green"> <s:property value="#request.edit_result"/> </font>
	<table>
				<tr>
					<td class="span-3 rt">用户名:</td>
					<td><s:property value="user.username" />
					</td>
				</tr>
				
				<tr>
					<td class="span-3 rt">电子邮件:</td>
					<td>
						<s:property value="user.email" />
					</td>
				</tr>
				
				<tr>
					<td class="span-3 rt">真实姓名:</td>
					<td><s:property value="user.realname" /></td>
				</tr>
				
				<tr>
					<td class="span-3 rt">出生日期:</td>
					<td><s:property value="user.csny" />
					</td>
				</tr>
				<tr>
					<td class="span-3 rt">手机（电话）:</td>
					<td><s:property value="user.phone" />
					</td>
				</tr>
				<tr>
					<td class="span-3 rt">地址:</td>
					<td><s:property value="user.address" />
					</td>
				</tr>
				
				<tr>
					<td class="span-3 rt">个人简介:</td>
					<td><s:property value="user.remark" />
					</td>
				</tr>
				</table>
			
	
 <jsp:include page="/foot.jsp"/>
 	</div>
</center>
	<script type="text/javascript" src="<%=path%>/script/jquery.validate-1.3.2.js"></script>
	 <script type="text/javascript" src="<%=path%>/script/jquery.validate.person.js"></script>
	 <script type="text/javascript" src="<%=path%>/script/jquery.validate.message_cn.js"></script>
<script type="text/javascript">
	$ (document).ready (function() {
		    $ ("#usersaddui").validate ({
		        rules: {
		           
		            'user.username': {
		                required:true,
		                maxlength:20
		            },
		            'user.email': {
		            	required:true,
		            	email:true,
		            	maxlength:20
		            }
		           
		        }
		    });

		});
	function checkUserName(){
		//alert($("#number").attr("value").length);
		if($("#userEmail").attr("value") == "" || $("#userEmail").attr("value").length >20 ){
			return false;
		}
		$("#conmessage").html("<img src='<%=path%>/images/ajax-loader.gif'/>");
		var params = $("#usersaddui").serialize();
		$.ajax({
			url:"<%=path%>/logon/userreg_checkUserByName.action",
			type:"POST",
			data:params,
			dataType:"json",
			success:function(data){
				//清空显示层中的数据
				//$("#conmessage").html("");
				if(data.message == "不存在"){
					 //$("#conmessage").html("<div><font color='red'>"+"不存在!"+"</font></div>")
					 $("#conmessage").html("<font color='green'>可用!</font>");
					 $('#savebutton').removeAttr("disabled");
				}
				else{//为显示层添加获取到的数据
					 $("#conmessage").html("已经存在，请换一个再试!");
					
					 $('#savebutton').attr('disabled',"true");

				}
			}
		});
	}

	function checkEmail(){
		//alert($("#number").attr("value").length);
		if($("#userName").attr("value") == "" || $("#userName").attr("value").length >20 ){
			return false;
		}
		$("#mailmessage").html("<img src='<%=path%>/images/ajax-loader.gif'/>");
		var params = $("#usersaddui").serialize();
		$.ajax({
			url:"<%=path%>/logon/userreg_checkUserByEmail.action",
			type:"POST",
			data:params,
			dataType:"json",
			success:function(data){
				//清空显示层中的数据
				//$("#conmessage").html("");
				if(data.message == "不存在"){
					 //$("#conmessage").html("<div><font color='red'>"+"不存在!"+"</font></div>")
					 $("#mailmessage").html("<font color='green'>可用!</font>");
					 $('#savebutton').removeAttr("disabled");
				}
				else{//为显示层添加获取到的数据
					 $("#mailmessage").html("已经存在，请换一个再试!");
					
					 $('#savebutton').attr('disabled',"true");

				}
			}
		});
	}
	
 
</script>
</body>
</html>
